﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class UserBackGround_CheckInfo : System.Web.UI.Page
{
    Operation operation = new Operation(); //业务类对象
    static string userid;　　　　　 

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["Admin"] == null)
            {
                WebMessageBox.Show("会话失效，请重新登录！");
            }
            else
            {
                userid = Request.QueryString["id"].ToString();
                //oldpwd.Text = operation.SelectUserInfo(userid).Tables[0].Rows[0][2].ToString();
            }
        }
    }
    protected void mdfy_Click(object sender, EventArgs e)
    {
        if (Request.QueryString["op"] != null)
        {
            operation.UpdateSysPwd(password.Text.Trim(), userid);
            WebMessageBox.Show("管理员密码修改成功！", "AdminManager.aspx");
        }
        else
        {
            operation.UpdateUserPwd(password.Text.Trim(), userid);
            WebMessageBox.Show("用户密码修改成功！", "UserManager.aspx");
        }
    }
}